clear()
n = get_world_size()
while True:
	if num_items(Items.Hay)>100000 and num_items(Items.wood)>100000:
		for x in range(0,n):
			for y in range(0,n):
				if can_harvest() and get_entity_type() == Entities.Carrot:
					harvest()
					plant(Entities.Carrot)
				else:
					till()
					plant(Entities.Carrot)
				move(East)
			move(North)

	elif num_items(Items.Hay)<1000000:
		for x in range(0,n):
			for y in range(0,n):
				harvest()
				move(East)
			move(North)

	elif num_items(Items.Wood)<1:
		for x in range(0,n):
			for y in range(0,n):
				if can_harvest():
					harvest()
					plant(Entities.Bush)
				else:
					plant(Entities.Bush)
				move(East)
			move(North)
	else:
		pass

				
	




	